﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace virtualAndOverride

{
    public class nguoi
    {
        protected int tay;
        protected int chan;
        protected string mauDa;
        protected string thucAn;

        public nguoi()
        {
            tay = 2;
            chan = 2;
            mauDa = "Vang";
            thucAn="Com";
        }
        public nguoi(string daMau,string ta)
        {
            tay = 2;
            chan = 2;
            this.mauDa=daMau;
            this.thucAn=ta;
        }
        public nguoi(int soTay,int soChan,string daMau,string ta)
        {
          tay=soTay;
          chan = soChan;
          mauDa = daMau;
          thucAn = ta;

        }
        public void thongTinNhanVat()
        {
            Console.WriteLine("Nguoi thi co so tay la:{0}",tay);
            Console.WriteLine("Nguoi di bang so chan:{0}",chan);
            Console.WriteLine("Mau da cua nguoi la:{0}",mauDa);
            Console.WriteLine("Thuc an chu yeu la:{0}",thucAn);
        }
        public virtual void diChuyen()
        {
            Console.WriteLine("Nguooi dang di bo!");
        }
    }
   public class chienBinh:nguoi
    {
       protected int noiLuc;
       protected int khangDoc;
       protected string binhKhi, aoGiap;

        public chienBinh()
            : base("Da Trang", "Banh my")
        {
            base.tay = 1;
        }
        public chienBinh()
        {
            noiLuc = 486;
            khangDoc = 15;
            binhKhi = "Kiem";
            aoGiap = "32";
        }
        public void thongTinChienBinh()
        {
            Console.WriteLine("Noi Luc:{0}",noiLuc);
            Console.WriteLine("Khang Doc:{0}",khangDoc);
            Console.WriteLine("Binh Khi co ban:{0}",binhKhi);
            Console.WriteLine("Chi so giap co ban:{0}",aoGiap);
        }
        public override void diChuyen()
        {
            base.diChuyen();
            Console.WriteLine("Chien binh phai lao len!");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            chienBinh cb = new chienBinh();
            cb.thongTinChienBinh();
            cb.thongTinNhanVat();
            cb.diChuyen();
        }
    }
}
